package org.dtrd.modules.patient.entity.bean.report;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.archive.entity.bean.report.PhysicalReport;
import org.dtrd.modules.archive.entity.po.DtrdEntRdArchiveLifeway;
import org.dtrd.modules.archive.entity.po.DtrdEntRdArchivePhysical;

/**
 * @author qr
 * @date 2022/1/20 13:42
 */
@ApiModel("生活方式")
@Getter
@Setter
public class LifewayReportBean {

    @ApiModelProperty("评分")
    private Integer score;

    @ApiModelProperty("小结")
    private String comment;

    public LifewayReportBean eatParseFromPO(DtrdEntRdArchiveLifeway po) {
        score = po.getEatingHabitsScore() == null ? 0 : po.getEatingHabitsScore();
        comment = po.getEatingHabitsComment() == null ? "" : po.getEatingHabitsComment();
        return this;
    }

    public LifewayReportBean drinkParseFromPO(DtrdEntRdArchiveLifeway po) {
        score = po.getDrinkingHabitsScore() == null ? 0 : po.getDrinkingHabitsScore();
        comment = po.getDrinkingHabitsComment() == null ? "" : po.getDrinkingHabitsComment();
        return this;
    }

    public LifewayReportBean sleepParseFromPO(DtrdEntRdArchiveLifeway po) {
        score = po.getSleepHabitsScore() == null ? 0 : po.getSleepHabitsScore();
        comment = po.getSleepHabitsComment() == null ? "" : po.getSleepHabitsComment();
        return this;
    }

    public LifewayReportBean smokingParseFromPO(DtrdEntRdArchiveLifeway po) {
        score = po.getSmokingHabitsScore() == null ? 0 : po.getSmokingHabitsScore();
        comment = po.getSmokingHabitsComment() == null ? "" : po.getSmokingHabitsComment();
        return this;
    }

    public LifewayReportBean exerciseParseFromPO(DtrdEntRdArchiveLifeway po) {
        score = po.getExerciseHabitsScore() == null ? 0 : po.getExerciseHabitsScore();
        comment = po.getExerciseHabitsComment() == null ? "" : po.getExerciseHabitsComment();
        return this;
    }
}
